#pragma once
//============================================================================
// Copyright (C) 2003Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#include "ISceneNode.h"
#include "ISceneCollisionManager.h"

namespace irr
{
namespace scene
{

class VxHealthSceneNode : public ISceneNode
{
public:

	//! constructor
	VxHealthSceneNode(	ISceneNode* parent,		
						ISceneManager* mgr, 
						s32 id,
						scene::ISceneCollisionManager* coll,
						s32 width = 100,
						s32 height = 10,
						const core::vector3df& position = core::vector3df(0,0,0),
						video::SColor BarColor=video::SColor(150,0,200,0),
						video::SColor BkgColor=video::SColor(150,200,0,0),
						video::SColor BoarderColor=video::SColor(200,220,220,220) ); 

	//! destructor
	virtual ~VxHealthSceneNode();

	#ifdef USE_IRRSPINTZ
		void OnBeginScene( const u32& timeMs );
	#else
		virtual void OnRegisterSceneNode();
	#endif // USE_IRRSPINTZ

	//! renders the node.
	virtual void render();

	//! returns the axis aligned bounding box of this node
	virtual const core::aabbox3d<f32>& getBoundingBox() const;

	//! returns amount of materials used by this scene node.
	virtual u32 getMaterialCount();

	//! sets progress percentage ( or health )
	virtual void setProgress( s32 s32Percent );

	//! sets the color of the progress bar
	virtual void setProgressColor(video::SColor color);

	//! sets the color of the progress bar background
	virtual void setBackgroundColor(video::SColor color);

	//! sets the color of the progress bar border
	virtual void setBorderColor(video::SColor color);


private:

	core::aabbox3d< f32 >	Box;
	video::SMaterial		material; 
	video::SColor			BarColor;
	video::SColor			BorderColor;
	video::SColor			BkgColor;
	scene::ISceneCollisionManager* Coll;
	core::dimension2d<s32>	m_oDim; //dimension width, height
	s32						m_bBorder;
	s32						MaxNum;
	s32						isVisible;
	s32						m_s32Percent;

};

} // end namespace scene
} // end namespace irr


